package com.wyyc.common.carillegalrecord.repository;

import com.wyyc.entity.CarIllegalRecordEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Hwei~ on 2017/6/7.
 */
@Repository
@Transactional
public interface CarIllegalRecordRepository extends PagingAndSortingRepository<CarIllegalRecordEntity,Integer>,JpaRepository<CarIllegalRecordEntity,Integer> {
    //根据车辆ID查询记录
    @Query("FROM CarIllegalRecordEntity cr WHERE cr.carId = ?1")
    List<CarIllegalRecordEntity> findByCarId(int carId);
}
